<pre class="docs-method-signature"><code>polyline.tangentAtLength(length)</code></pre>
<p>Return a line tangent to the polyline at point that lies <code>length</code> away from the beginning of the polyline.</p>

<p>If negative <code>length</code> is provided, the algorithm starts looking from the end of the polyline. If <code>length</code> is higher than the length of the polyline, a line tangent to the closest valid polyline endpoint is returned instead.</p>

<p>The tangent line starts at the point at <code>length</code>. The direction from <code>start</code> to <code>end</code> is the same as the direction of the polyline segment at the specified point. If the specified point is a point of discontinuity (e.g. it is a point shared by two polyline segments with different slopes), the tangent line is constructed for the earlier segment (i.e. the segment closer to the beginning of the polyline).</p>

<p>The algorithm ignores polyline segments that have zero length. If the polyline contains no valid segments (i.e. all polyline points are coincident), <code>null</code> is returned. If the polyline has fewer than two points (exclusive), <code>null</code> is returned, as well. The <code>polyline.isDifferentiable()</code> <a href="#g.Polyline.prototype.isDifferentiable">function</a> may be used in advance to determine whether the polyline contains at least one valid segment for wich a tangent may be found.</p>
